//
//  GasListCell.m
//  NtoccDriverNew
//
//  Created by niyongsheng on 2022/10/18.
//  Copyright © 2022 GCY. All rights reserved.
//

#import "GasListCell.h"

@interface GasListCell ()
@property (weak, nonatomic) IBOutlet UILabel *orderNoL;
@property (weak, nonatomic) IBOutlet UILabel *textL1;
@property (weak, nonatomic) IBOutlet UILabel *textL2;
@property (weak, nonatomic) IBOutlet UILabel *textL3;
@property (weak, nonatomic) IBOutlet UILabel *textL4;
@property (weak, nonatomic) IBOutlet UILabel *textL5;
@property (weak, nonatomic) IBOutlet UILabel *textL6;

@property (weak, nonatomic) IBOutlet UIButton *payBtn;
@property (weak, nonatomic) IBOutlet UIButton *cancelBtn;

@property (weak, nonatomic) IBOutlet UIView *optionView;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *optionViewH;
@end

@implementation GasListCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
    ViewRadius(_payBtn, 4)
    ViewBorderRadius(_cancelBtn, 4, 1, Theme_ColorValue)
}

- (void)setModel:(GasListModel *)model {
    _model = model;
    
    _orderNoL.text = model.serialNo;
    _textL1.text = model.stationName;
    _textL2.text = model.oilType == 1 ? @"汽油" : @"柴油";
    _textL3.text = model.oilLabel;
    _textL4.text = model.oilPrice;
//    _textL4.text = [NSString stringWithFormat:@"%f", model.oilPrice];
    _textL5.text = model.totalPrice;
    _textL6.text = model.gmtCreated;
    
    if (model.transactionStatus.intValue == 0) {
        _optionView.hidden = NO;
        _optionViewH.constant = 55;
        
    } else {
        _optionView.hidden = YES;
        _optionViewH.constant = 0;
        
    }
}

- (IBAction)payBtnOnclicked:(UIButton *)sender {
    if (_block)
        self.block(1);
}

- (IBAction)cancelBtnOnclicked:(UIButton *)sender {
    if (_block)
        self.block(0);
}

@end
